import { handleRouter } from './handle-router'
import { rewriteRouter } from './rewrite-router'

let _apps = []

export const getApps = () => _apps

export const start = () => {
  //  微前端运行原理
  //  1、监视路由变化
  rewriteRouter()
  //  需要手动的初始执行匹配 避免在刷新或首次进入后没有走匹配逻辑
  handleRouter()
  //  2、匹配子应用
  //  3、加载子应用
  //  4、渲染子应用
}

export const registerMicroApps = apps => {
  console.log(apps, 'apps=========')
  _apps = apps
}
